package model

import (
	"gorm.io/gorm"
	"time"
)

type ChatGroupUser struct {
	Id          uint           `gorm:"column:id;type:bigint(20) UNSIGNED;primaryKey;not null;" json:"id"`
	GroupUserId uint           `gorm:"column:group_user_id;type:bigint(20) UNSIGNED;not null;" json:"group_user_id"`
	GroupId     uint           `gorm:"column:group_id;type:bigint(20) UNSIGNED;not null;" json:"group_id"`
	Level       uint           `gorm:"column:level;type:int(10);comment:权限：1-群主 2-管理员 3-成员;not null;" json:"level"` // 权限：1-群主 2-管理员 3-成员
	CreatedAt   time.Time      `gorm:"column:created_at;type:datetime(3);not null;default:CURRENT_TIMESTAMP(3);" json:"created_at"`
	UpdatedAt   time.Time      `gorm:"column:updated_at;type:datetime(3);not null;default:CURRENT_TIMESTAMP(3);" json:"updated_at"`
	DeletedAt   gorm.DeletedAt `gorm:"column:deleted_at;type:datetime(3);default:NULL;" json:"deleted_at"`
}

func (c *ChatGroupUser) TableName() string {
	return "chat_group_user"
}
